#pragma once

#include <string>
#include <vector>
#include <rockchip/mpp_packet.h>
#include <rockchip/rk_mpi.h>
#include <EGL/eglext.h>

const std::string GLSL_VERSION_STRING("#version 320 es");
const char* vertex_shader =
                                    "precision highp float;\n"
                                    "attribute mediump vec2 position;\n"
                                    "attribute mediump vec2 texcoord;\n"
                                    "varying mediump vec2 outtexcoord;\n"
                                    "void main()\n"
                                    "{\n"
                                    "  gl_Position = vec4(position, 0.0, 1.0);\n"
                                  "  outtexcoord = vec2(texcoord.x, texcoord.y);\n"
//                                  "  outtexcoord = vec2(texcoord.x, 1.0 - texcoord.y);\n"
                                    "}";
const char* oes_fragment_shader =
                                        "#extension GL_OES_EGL_image_external : require\n"
                                        "precision highp float;\n"
                                        "varying mediump vec2 outtexcoord;\n"
                                        "uniform samplerExternalOES tex;\n"
                                        "void main()\n"
                                        "{\n"
                                        "  gl_FragColor = texture2D(tex, outtexcoord.st);\n"
                                        "}";
const char* fragment_shader =
                                    "precision highp float;\n"
                                    "varying mediump vec2 outtexcoord;\n"
                                    "uniform sampler2D tex;\n"
                                    "void main()\n"
                                    "{\n"
                                    "  gl_FragColor = texture2D(tex, outtexcoord.st);\n"
                                    "}";


const std::vector<std::pair<MppFrameColorSpace, std::string>> MPP_COLOUR_SPACES =
{
  std::make_pair(MPP_FRAME_SPC_RGB, "MPP_FRAME_SPC_RGB"),
  std::make_pair(MPP_FRAME_SPC_BT709, "MPP_FRAME_SPC_BT709"),
  std::make_pair(MPP_FRAME_SPC_UNSPECIFIED, "MPP_FRAME_SPC_UNSPECIFIED"),
  std::make_pair(MPP_FRAME_SPC_FCC, "MPP_FRAME_SPC_FCC"),
  std::make_pair(MPP_FRAME_SPC_BT470BG, "MPP_FRAME_SPC_BT470BG"),
  std::make_pair(MPP_FRAME_SPC_SMPTE170M, "MPP_FRAME_SPC_SMPTE170M"),
  std::make_pair(MPP_FRAME_SPC_SMPTE240M, "MPP_FRAME_SPC_SMPTE240M"),
  std::make_pair(MPP_FRAME_SPC_YCOCG, "MPP_FRAME_SPC_YCOCG"),
  std::make_pair(MPP_FRAME_SPC_BT2020_NCL, "MPP_FRAME_SPC_BT2020_NCL"),
  std::make_pair(MPP_FRAME_SPC_BT2020_CL, "MPP_FRAME_SPC_BT2020_CL"),
  std::make_pair(MPP_FRAME_SPC_SMPTE2085, "MPP_FRAME_SPC_SMPTE2085"),
  std::make_pair(MPP_FRAME_SPC_CHROMA_DERIVED_NCL, "MPP_FRAME_SPC_CHROMA_DERIVED_NCL"),
  std::make_pair(MPP_FRAME_SPC_CHROMA_DERIVED_CL, "MPP_FRAME_SPC_CHROMA_DERIVED_CL"),
  std::make_pair(MPP_FRAME_SPC_ICTCP, "MPP_FRAME_SPC_ICTCP")
};
const std::vector<std::pair<MppFrameColorRange, std::string>> MPP_COLOUR_RANGES =
{
  std::make_pair(MPP_FRAME_RANGE_UNSPECIFIED, "MPP_FRAME_RANGE_UNSPECIFIED"),
  std::make_pair(MPP_FRAME_RANGE_MPEG, "MPP_FRAME_RANGE_MPEG"),
  std::make_pair(MPP_FRAME_RANGE_JPEG, "MPP_FRAME_RANGE_JPEG")
};
const std::vector<std::pair<MppFrameColorPrimaries, std::string>> MPP_COLOUR_PRIMARIES =
{
  std::make_pair(MPP_FRAME_PRI_BT709, "MPP_FRAME_PRI_BT709"),
  std::make_pair(MPP_FRAME_PRI_UNSPECIFIED, "MPP_FRAME_PRI_UNSPECIFIED"),
  std::make_pair(MPP_FRAME_PRI_BT470M, "MPP_FRAME_PRI_BT470M"),
  std::make_pair(MPP_FRAME_PRI_BT470BG, "MPP_FRAME_PRI_BT470BG"),
  std::make_pair(MPP_FRAME_PRI_SMPTE170M, "MPP_FRAME_PRI_SMPTE170M"),
  std::make_pair(MPP_FRAME_PRI_SMPTE240M, "MPP_FRAME_PRI_SMPTE240M"),
  std::make_pair(MPP_FRAME_PRI_FILM, "MPP_FRAME_PRI_FILM"),
  std::make_pair(MPP_FRAME_PRI_BT2020, "MPP_FRAME_PRI_BT2020"),
  std::make_pair(MPP_FRAME_PRI_SMPTEST428_1, "MPP_FRAME_PRI_SMPTEST428_1"),
  std::make_pair(MPP_FRAME_PRI_SMPTE431, "MPP_FRAME_PRI_SMPTE431"),
  std::make_pair(MPP_FRAME_PRI_SMPTE432, "MPP_FRAME_PRI_SMPTE432"),
  std::make_pair(MPP_FRAME_PRI_JEDEC_P22, "MPP_FRAME_PRI_JEDEC_P22")
};
const std::vector<std::pair<int, std::string>> EGL_COLOUR_SPACES =
{
  std::make_pair(EGL_ITU_REC601_EXT, "EGL_ITU_REC601_EXT"),
  std::make_pair(EGL_ITU_REC709_EXT, "EGL_ITU_REC709_EXT"),
  std::make_pair(EGL_ITU_REC2020_EXT, "EGL_ITU_REC2020_EXT")
};
const std::vector<std::pair<int, std::string>> EGL_COLOUR_RANGES =
{
  std::make_pair(EGL_YUV_FULL_RANGE_EXT, "EGL_YUV_FULL_RANGE_EXT"),
  std::make_pair(EGL_YUV_NARROW_RANGE_EXT, "EGL_YUV_NARROW_RANGE_EXT")
};
